#ifndef _USART_BASE_H
#define _USART_BASE_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "stdint.h"
#define UART_TX_BUFFER_SIZE 64
#ifdef __cplusplus
}
#endif

typedef union 
{
    /* data */
    uint8_t data_u8[4];
    float change_float;
}change_type_union;

class Usart_Base
{
private:
    change_type_union * float_data = nullptr;
    uint8_t float_num;
    uint8_t all_len;
public:
    uint8_t tx_buff[UART_TX_BUFFER_SIZE];
    void SetFloatData(float * _data,uint8_t len);
    void MergeData();
    virtual void UsartTransmitFloat() = 0;
    uint8_t getAllLen(){return all_len;}
    uint8_t * getResult(){return tx_buff;}
};

#endif
